package commondata;

import java.util.List;

public class NbaTeam implements ITeam {

	private int teamID;

	private String teamName;

	private String teamLogoName;

	private double teamPayroll;

	private double teamWageBudget;

	private TradeGoalEnum tradeGoal;

	private List<Integer> ownedPlayerIds;

	private int win;
	
	private int loss;

	private double pointPG;

	private double assistPG;

	private double reboundPG;

	private double blockPG;

	private double stealPG;

	public NbaTeam(int teamID, String teamName, String teamLogoName, int win, int loss) {
		super();
		this.teamID = teamID;
		this.teamName = teamName;
		this.teamLogoName = teamLogoName;
		this.win = win;
		this.loss = loss;		
	}
	
	/* (non-Javadoc)
	 * @see commondata.ITeam#getAssistPG()
	 */
	public double getAssistPG() {
		return assistPG;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setAssistPG(double)
	 */
	public void setAssistPG(double assistPG) {
		this.assistPG = formatDouble(assistPG);
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getBlockPG()
	 */
	public double getBlockPG() {
		return blockPG;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setBlockPG(double)
	 */
	public void setBlockPG(double blockPG) {
		this.blockPG = formatDouble(blockPG);
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getPointPG()
	 */
	public double getPointPG() {
		return pointPG;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setPointPG(double)
	 */
	public void setPointPG(double pointPG) {
		this.pointPG = formatDouble(pointPG);
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getReboundPG()
	 */
	public double getReboundPG() {
		return reboundPG;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setReboundPG(double)
	 */
	public void setReboundPG(double reboundPG) {
		this.reboundPG = formatDouble(reboundPG);
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getStealPG()
	 */
	public double getStealPG() {
		return stealPG;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setStealPG(double)
	 */
	public void setStealPG(double stealPG) {
		this.stealPG = formatDouble(stealPG);
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getOwnedPlayerIds()
	 */
	public List<Integer> getOwnedPlayerIds() {
		return ownedPlayerIds;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setOwnedPlayerIds(java.util.List)
	 */
	public void setOwnedPlayerIds(List<Integer> ownedPlayerIds) {
		this.ownedPlayerIds = ownedPlayerIds;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getTeamID()
	 */
	public int getTeamID() {
		return teamID;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setTeamID(int)
	 */
	public void setTeamID(int teamID) {
		this.teamID = teamID;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getTeamLogoName()
	 */
	public String getTeamLogoName() {
		return teamLogoName;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setTeamLogoName(java.lang.String)
	 */
	public void setTeamLogoName(String teamLogoName) {
		this.teamLogoName = teamLogoName;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getTeamName()
	 */
	public String getTeamName() {
		return teamName;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setTeamName(java.lang.String)
	 */
	public void setTeamName(String teamName) {
		this.teamName = teamName;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getTeamPayroll()
	 */
	public double getTeamPayroll() {
		return teamPayroll;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setTeamPayroll(double)
	 */
	public void setTeamPayroll(double teamPayroll) {
		this.teamPayroll = formatDouble(teamPayroll);
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getTeamWageBudget()
	 */
	public double getTeamWageBudget() {
		return teamWageBudget;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setTeamWageBudget(double)
	 */
	public void setTeamWageBudget(double teamWageBudget) {
		this.teamWageBudget = teamWageBudget;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#getTradeGoal()
	 */
	public TradeGoalEnum getTradeGoal() {
		return tradeGoal;
	}

	/* (non-Javadoc)
	 * @see commondata.ITeam#setTradeGoal(commondata.TradeGoalEnum)
	 */
	public void setTradeGoal(TradeGoalEnum tradeGoal) {
		this.tradeGoal = tradeGoal;
	}

	public int getWin() {
		return win;
	}

	public void setWin(int win) {
		this.win = win;
	}

	public int getLoss() {
		return loss;
	}

	public void setLoss(int loss) {
		this.loss = loss;
	}
	
	double formatDouble(double d){
		int in = (int) (d * 1000);
		return ((double)in / 1000);
	}

}
